﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="rolemange.aspx.cs" Inherits="Sys_rolemange" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>角色管理</title>
      	<link rel="stylesheet" type="text/css" href="../js/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../js/themes/icon.css"/>
	<link rel="stylesheet" type="text/css" href="../CSS/Style.css"/>
	<link rel="stylesheet" type="text/css" href="../js/artDialog/skin/aero.css" />
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../js/artDialog/artDialog.min.js"></script> 
	<script type="text/javascript">
	  function addrole(){
             var url="../sys/authorityadd.aspx";
			art.dialog.open(url,{id:"addrole",title:"增加角色",width:"600px",height:"400px",skin:"aero",lock:true,
         closeFn: function(){window.location.reload();}
         });
		}
	</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
  <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div style="background:#efefef;">
		<a href="javascript:addrole()" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="addrole()">增加角色</a>
	</div>	
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <webdiyer:aspnetpager id="AspNetPager1" runat="server"
                        HorizontalAlign="Right" LastPageText="末页" NextPageText="下一页" 
                        PageIndexBoxType="TextBox" PageSize="15" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        ShowPageIndexBox="Always" Width="100%" CustomInfoHTML="共<font color=blue><b>%RecordCount%</b></font>条数据 每页：<font color=blue><b>%PageSize%</b></font> 条 共<font color=blue><b>%PageCount%</b></font>页 当前页：<font color=red><b>%CurrentPageIndex%/%PageCount%</b></font>" OnPageChanged="AspNetPager1_PageChanged" CustomInfoSectionWidth="50%" FirstPageText="首页" AlwaysShow="True" CustomInfoTextAlign="Left">
                </webdiyer:aspnetpager>
                <br />
                <asp:GridView ID="GridView1" runat="server" CssClass="gvStyle" AlternatingRowStyle-CssClass="alt" PagerStyle-CssClass="pgr" OnRowCommand="GridView1_RowCommand" AutoGenerateColumns="False" Width="100%" Font-Bold="False" EmptyDataText="暂时没有任何角色！" OnRowCancelingEdit="GridView1_RowCancelingEdit" EnableTheming="False" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" DataKeyNames="id" OnRowDataBound="GridView1_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="序号">
                            <ItemTemplate> 
                                 <%# (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + Container.DataItemIndex + 1%>
                            </ItemTemplate> 
                            <ItemStyle Width="30px" />
                                </asp:TemplateField>
                        <asp:BoundField DataField="typename" HeaderText="角色名称" />
                        <asp:BoundField DataField="typeid" HeaderText="角色编号" ReadOnly="True" >
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="rating" HeaderText="级别" ReadOnly="True" />
                        <asp:CheckBoxField DataField="state" HeaderText="状态" ReadOnly="False" >
                            <ItemStyle Width="50px" />
                        </asp:CheckBoxField>
                        <asp:CommandField ShowEditButton="True" ButtonType="Image" CancelImageUrl="~/js/themes/icons/undo.png" EditImageUrl="~/js/themes/icons/pencil.png" UpdateImageUrl="~/js/themes/icons/filesave.png" >
                            <ItemStyle Width="80px" />
                        </asp:CommandField>
                        <asp:TemplateField HeaderText="删除">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" CommandName="deleterole" ImageUrl="~/js/themes/icons/cancel.png" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick='return confirm("您确定要删除此角色？");' />&nbsp;
                            </ItemTemplate>
                            <ItemStyle Width="50px" />
                        </asp:TemplateField>
                    </Columns>
                         <PagerStyle CssClass="pgr" />
                     <AlternatingRowStyle CssClass="alt" />
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel></div> 
 </div>
    </form>
</body>
</html>
